package cn.maidouya.hrm.controller;

import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
public class LongUserController {
    @PostMapping("/success")
    public String success(){
        String name = SecurityContextHolder.getContext().getAuthentication().getName();
        return name+"登录成功";
    }
}